home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / netBoot / sun3.md / getidprom.s < prev    next >
Encoding:
Text File  |  1990-08-14  |  964 b   |  41 lines

  1. |
  2. |     @(#)getidprom.s 1.2 88/02/08 Copyright (c) 1985 by Sun Microsystems, Inc.
  3. |
  4. #ifdef sun2
  5. #define    FC_MAP        3
  6. #define    BYTESPERPG    0x800
  7. #define    IDPROMOFF    8
  8. #endif
  9. #ifdef sun3
  10. #define    FC_MAP        3
  11. #define    BYTESPERPG    0x2000
  12. #define    IDPROMOFF    0
  13. #endif
  14.  
  15.  
  16. |
  17. | getidprom(addr, size)
  18. |
  19. | Read back <size> bytes of the ID prom and store them at <addr>.
  20. | Typical use:  getidprom(&idprom_struct, sizeof(idprom_struct));
  21. |
  22.     .globl    _getidprom
  23. _getidprom:
  24.     movl    sp@(4),a0    | address to move ID prom bytes to
  25.     movl    sp@(8),d1    | How many bytes to move
  26.     movl    d2,sp@-        | save a reg
  27.     movc    sfc,d0        | save source func code
  28.     movl    #FC_MAP,d2
  29.     movc    d2,sfc        | set space 3
  30.     lea    IDPROMOFF,a1    | select id prom
  31.     jra    good        | Enter loop at bottom as usual for dbra
  32. loop:    movsb    a1@+,d2        | get a byte
  33.     movb    d2,a0@+        | save it
  34. #ifdef sun2
  35.     addw    #BYTESPERPG-1,a1 | address next byte (in next page)
  36. #endif sun2
  37. good:    dbra    d1,loop        | and loop
  38.     movc    d0,sfc        | restore sfc
  39.     movl    sp@+,d2        | restore d2
  40.     rts
  41.